<template>
	<div>
		<view>
			<button type="primary" @click="updatefile()">选择图片</button>
			<image v-for="item in images" :src="item"></image>
			<button type="primary" @click="insertUidTid()">确认上传</button>
		</view>
	</div>
</template>

<script>
	let caseTaskVo={}
	export default {
			data() {
				return {
					images:[]
				}
			},
			methods:{
				insertUidTid(){
					console.log("----"+caseTaskVo.situationTid)
					uni.request({
					    url: 'http://localhost:7000/task/task/taskSituation', 
					    data:{
							situationTid:caseTaskVo.situationTid,
							situationPic:this.images[0]
						},
					    method: 'POST',
					    success: (res) => {
							uni.navigateTo({
								url:'/pages/task/index'
							})
					    }
					});
				},
				updatefile(){
					uni.chooseImage({
						count:2,
						success:res=> {
							this.images=res.tempFilePaths
							console.log(this.images[0])
						}
					})
				}
			},
			onLoad:function(obj){
				caseTaskVo.situationTid=obj.situationTid
			}
		}
</script>

<style>
</style>
